package com.chao.wind3j.controller;

import com.chao.wind3j.base.apiResult.ApiResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@ResponseBody
public class ExceptionController {
  /**
   * 处理其他所有未知的异常
   *
   * @param e 捕获异常类
   * @return
   */
  @ExceptionHandler({Exception.class})
  public ApiResult<Boolean> globalExceptionHandler(Exception e) {
    return ApiResult.fail(e);
  }

}
